<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.test.clyq.entity.*"%>
<%@ page import="com.test.clyq.service.*"%>
<%@ page import="com.test.util.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Map.*,org.dom4j.DocumentException"%>
<%@ page import="com.test.Constants"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>工作日志管理</title>
	</head>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
		style="font-size: 13px;">
		<%
			UsersLogService usersLogService = (UsersLogService) Constants.ctx.getBean("usersLogService");

			String lId = request.getParameter("lId");
			UsersLog userLog = usersLogService.getUsersLogById(Long.valueOf(lId));
			try {
				userLog.getSelf();
			}
			catch (DocumentException e) {
			}

			userLog.setOperateDataTypeStr(ItemUtil.TYPENAMEMAP.get(userLog.getOperateDataType().intValue()));
			userLog.setOperateStatusStr(ItemUtil.STATUSMAP.get(userLog.getOperateStatus().intValue()));
			userLog.setOperateTypeStr(ItemUtil.OPERATORMAP.get(userLog.getOperateType().intValue()));
		%>
		<table width="95%" border="1" align="center" cellpadding="0"
			cellspacing="0" bordercolor="#C9C6D9"
			style="border-collapse: collapse;">
			<tr>
				<td>
					<table width="100%" border="0" align="center" cellpadding="2"
						cellspacing="0">
						<tr bgcolor="#BADBF1" style="font-size: 13px;">
							<td width="20%" height="20" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid;" align="center">
								操作时间
							</td>
							<td width="10%" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid; BORDER-LEFT: #FFFFFF 1px solid;"
								align="center">
								操作人
							</td>
							<td width="32%" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid; BORDER-LEFT: #FFFFFF 1px solid;"
								align="center">
								操作数据类型
							</td>
							<td width="10%" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid; BORDER-LEFT: #FFFFFF 1px solid;"
								align="center">
								操作数据主键
							</td>
							<td width="10%" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid; BORDER-LEFT: #FFFFFF 1px solid;"
								align="center">
								操作类型
							</td>
							<td width="10%" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid; BORDER-LEFT: #FFFFFF 1px solid;"
								align="center">
								操作状态
							</td>
							<td width="8%" class="lineBottom1"
								style="BORDER-LEFT: #FFFFFF 1px solid;">
								&nbsp;
							</td>
						</tr>
						<tr bgcolor="#DBEAF5" style="font-size: 12px;">
							<td height="28" align="center"><%=DateUtils.long2DateString(userLog.getOperateTime())%></td>
							<td align="center"><%=userLog.getUsersLoginName()%></td>
							<td align="center"><%=userLog.getOperateDataTypeStr()%></td>
							<td align="center"><%=userLog.getOperateTableKey() == null ? "" : userLog.getOperateTableKey()%></td>
							<td align="center">
								<%=userLog.getOperateTypeStr()%>
							</td>
							<td align="center"><%=userLog.getOperateStatusStr()%></td>

							<td align="center"></td>
						</tr>
					</table>
					<br />
					<table width="100%" border="0" align="center" cellpadding="2"
						cellspacing="0">
						<tr bgcolor="#BADBF1" style="font-size: 13px;">
							<td width="6%" height="20" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid;" align="center">
								数据名称
							</td>
							<td width="6%" height="20" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid;" align="center">
								旧数据
							</td>
							<td width="6%" height="20" class="lineBottom1"
								style="BORDER-RIGHT: #A6A1C1 1px solid;" align="center">
								新数据
							</td>
						</tr>

						<%
							if (userLog.getOperateDataType().intValue() == 5) {
						%>
						<tr bgcolor="#DBEAF5" style="font-size: 12px;">
							<td height="28" align="center">
								用户管理
							</td>
							<td align="center"></td>
							<td align="center" style="color: red;"><%=userLog.getAfterOperateData()%></td>
						</tr>
						<%
							} else {
								List contrastingDataList = userLog.getContrastingDataList();
								if (contrastingDataList != null && !contrastingDataList.isEmpty()) {
									int contrastingDataSize = contrastingDataList.size();
									for (int contrastingDataI = 0; contrastingDataI < contrastingDataSize; contrastingDataI++) {
										ContrastingData contrastingData = (ContrastingData) contrastingDataList.get(contrastingDataI);
						%>
						<tr bgcolor="#DBEAF5" style="font-size: 12px;">
							<td height="28" align="center"><%=contrastingData.getDataName()%></td>
							<td align="center" style=""><%=contrastingData.getOldData() == null ? "" : contrastingData.getOldData()%></td>
							<td align="center" style=""><%=contrastingData.getNewData() == null ? "" : contrastingData.getNewData()%></td>
						</tr>
						<%
							}
								}
							}
						%>

					</table>
				</td>
			</tr>
		</table>
	</body>
</html>
